﻿<Window x:Class="SBPweb.MediaCenter.Presentation.WPF.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:SBPweb.MediaCenter.Tools.WPF.Controls;assembly=SBPweb.MediaCenter.Tools.WPF"
    xmlns:tools3d="clr-namespace:_3DTools;assembly=3DTools"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
        Title="MainWindow"
        Width="800"
        Height="600"
        Background="Black">
    
    <Window.Resources>
        <MeshGeometry3D x:Key="PlaneMesh"
          Positions="-0.5,0.5,0  0.5,0.5,0  0.5,-0.5,0  -0.5,-0.5,0"
          Normals="0,1,0  0,1,0  0,1,0  0,1,0"
          TriangleIndices="0 3 1  1 3 2"
          TextureCoordinates="0 0  1 0  1 1  0 1"/>
        
        <Transform3DGroup x:Key="MenuTransform">
            <ScaleTransform3D ScaleX="2" />
            <RotateTransform3D>
                <RotateTransform3D.Rotation>
                    <AxisAngleRotation3D Axis="0,1,0" Angle="180" />
                </RotateTransform3D.Rotation>
            </RotateTransform3D>
        </Transform3DGroup>

        <Style x:Key="MenuPanelGrid" TargetType="{x:Type Grid}">
            <Setter Property="Background" Value="White" />
            <Setter Property="Height" Value="130" />
        </Style>

        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="Margin" Value="5,2,0,0" />
        </Style>

    </Window.Resources>

    <Grid x:Name="outerGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid x:Name="innerGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid.Background>
                <ImageBrush ImageSource="/SBPweb.MediaCenter.Presentation.WPF;component/Resources/Background.Aurora.1920x1200.png" Opacity="0.7" />
            </Grid.Background>
            <tools3d:TrackballDecorator>
                <tools3d:Interactive3DDecorator Margin="0,0,0,0">
                    <Viewport3D x:Name="viewport">
                        <Viewport3D.Camera>
                            <PerspectiveCamera x:Name="camPerspective" FieldOfView="45" LookDirection="0,0,-1" NearPlaneDistance="0" Position="0,2.5,20">
                                <PerspectiveCamera.Transform>
                                    <Transform3DGroup>
                                        <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                                        <ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1"/>
                                        <RotateTransform3D d:EulerAngles="0,0,0"/>
                                    </Transform3DGroup>
                                </PerspectiveCamera.Transform>
                            </PerspectiveCamera>
                        </Viewport3D.Camera>

                        <ModelVisual3D x:Name="lights">
                            <ModelVisual3D.Content>
                                <Model3DGroup>
                                    <AmbientLight Color="#777777" />
                                    <DirectionalLight Color="#BBBBBB" Direction="-1,-1,-1" />
                                </Model3DGroup>
                            </ModelVisual3D.Content>
                        </ModelVisual3D>

                        <ModelVisual3D x:Name="menuBaseVisual" />

                        <ModelVisual3D x:Name="smartPartsVisual" />

                        <!--tools3d:InteractiveVisual3D x:Name="mainMenuInteractive" Geometry="{StaticResource PlaneMesh}">
                        <tools3d:InteractiveVisual3D.Visual>
                            <StackPanel x:Name="mainMenuStack">
                                <TextBox />
                            </StackPanel>
                        </tools3d:InteractiveVisual3D.Visual>
                    </tools3d:InteractiveVisual3D-->

                        <!--controls:CarouselInteractiveVisual3D x:Name="carousel">
                        <controls:CarouselInteractiveVisual3D.Visual>
                            <Button x:Name="btest" Width="40" Height="20" />
                        </controls:CarouselInteractiveVisual3D.Visual>
                    </controls:CarouselInteractiveVisual3D-->

                        <!--blendables:Carousel3D x:Name="carousel"
										       UpDirection="1,0,0" ExpandedWidth="10" ExpandedDepth="10" State="Expanded"
										       SelectedIndexChangedAnimationDuration="0:0:0.3"
										       FrontLoadLayoutItemDeltaAngle="25" MaintainItemModelFrontDirection="False">
                        <blendables:Carousel3D.ItemModelGenerator>
                            <generators:InteractiveVisual3DModelGenerator
									      DefaultGeometry="{StaticResource PlaneMesh}"
									      ItemModelTransform="{StaticResource MenuTransform}" />
                        </blendables:Carousel3D.ItemModelGenerator>
                        <blendables:Carousel3D.Transform>
                            <RotateTransform3D>
                                <RotateTransform3D.Rotation>
                                    <AxisAngleRotation3D Axis="0,1,0" Angle="120" />
                                </RotateTransform3D.Rotation>
                            </RotateTransform3D>
                        </blendables:Carousel3D.Transform-->

                        <!--Grid Style="{StaticResource MenuPanelGrid}" Height="143" Background="{x:Null}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="35"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Border Background="#E500001C" BorderThickness="2,2,2,2" CornerRadius="5,5,5,5" Grid.RowSpan="2">
                                <Border.BorderBrush>
                                    <LinearGradientBrush EndPoint="-0.024,0.509" StartPoint="0.969,0.509">
                                        <GradientStop Color="#B2FFFFFF" Offset="0"/>
                                        <GradientStop Color="#19FFFFFF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.BorderBrush>
                            </Border>
                        </Grid>

                        <Grid Style="{StaticResource MenuPanelGrid}" Height="143" Background="{x:Null}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="35"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Border Background="#E500001C" BorderThickness="2,2,2,2" CornerRadius="5,5,5,5" Grid.RowSpan="2">
                                <Border.BorderBrush>
                                    <LinearGradientBrush EndPoint="-0.024,0.509" StartPoint="0.969,0.509">
                                        <GradientStop Color="#B2FFFFFF" Offset="0"/>
                                        <GradientStop Color="#19FFFFFF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.BorderBrush>
                            </Border>
                        </Grid-->

                        <!--/blendables:Carousel3D-->

                    </Viewport3D>

                </tools3d:Interactive3DDecorator>
            </tools3d:TrackballDecorator>
            <Label Name="lFPS"
                   Width="60"
                   Height="20"
                   Foreground="White"
                   FontSize="8"
                   HorizontalContentAlignment="Center"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Top"
                   VerticalContentAlignment="Center">FPS
            </Label>
        </Grid>
    </Grid>

</Window>